//
//  UIImage+ZMAdd.h
//  ZMKitDemo
//
//  Created by zm on 2018/6/13.
//  Copyright © 2018年 zm. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (ZMAdd)

#pragma mark - Color

+ (UIImage *)imageWithColor:(UIColor *)color;
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;

#pragma mark - TintColor
- (UIImage *)imageWithTintColor:(UIColor *)tintColor;
- (UIImage *)imageWithGradientTintColor:(UIColor *)tintColor;
- (UIImage *)imageWithTintColor:(UIColor *)tintColor blendMode:(CGBlendMode)blendMode;

#pragma mark - Size/Crop
/**
 缩放UIImage尺寸

 @param size 目标尺寸
 @return 缩放尺寸后的UIImage
 */
- (UIImage *)scaleToSize:(CGSize)size;

/**
 裁剪UIImage

 @param cropRect 裁剪尺寸
 @return 裁剪后的UIImage
 */
- (UIImage *)cropImageToRect:(CGRect)cropRect;

#pragma mark - Border
/**
 UIImage绘制圆角

 @param borderWidth 边框宽度
 @param borderColor 边框颜色
 @return 绘制圆角之后的UIImage
 */
- (UIImage *)circleWithBorderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor;


#pragma mark - Orientation
/**
 修正UIImage的方向
 
 @return 修正方向后的UIImage
 */
- (UIImage *)fixOrientation;
/**
 按给定的方向旋转图片
 */
- (UIImage*)rotate:(UIImageOrientation)orient;

/**
 垂直翻转
 */
- (UIImage *)flipVertical;

/**
 水平翻转
 */
- (UIImage *)flipHorizontal;

/**
 将图片旋转degrees角度
 */
- (UIImage *)imageRotatedByDegrees:(CGFloat)degrees;

/**
 将图片旋转radians弧度
 */
- (UIImage *)imageRotatedByRadians:(CGFloat)radians;
@end
